package com.pzhu.keycloak;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class KeycloakController {

    @Autowired
    private KeycloakService keycloakService;

    @GetMapping("/get-token")
    public String getToken(@RequestParam String username, @RequestParam String password) {
        return keycloakService.getAccessToken(username, password);
    }
}
